package com.protocolterminal.AFN;

import java.util.ArrayList;
import java.util.List;

public class AFN02 extends BaseAFN {

	public AFN02(String framedata) {

 		this.AFN = framedata.substring(0, 2);
		this.SEQ = framedata.substring(2, 4);
		List<String> dalist = new ArrayList<>();
		dalist.add(framedata.substring(4, 8));
		this.DA = dalist;
		List<String> dtlist = new ArrayList<>();
		dtlist.add(framedata.substring(8, 12));
		this.DT = dtlist;

		int i = 12;
		List<String> datalist = new ArrayList<>();
		switch (this.DT.get(0)) {
		case "0100":
			datalist.add("");
			break;
		case "0200":
			datalist.add("");
			break;
		case "0400":
			datalist.add(framedata.substring(12, 24));
			i = 24;
			break;
		default:
			break;
		}
		this.Data = datalist;

		this.AUX = framedata.substring(i);

	}
	
	

}
